package main

import (
	"demo1/cache"
	"demo1/db"
	"demo1/middleware"
	"gitee.com/baizhige/simple-auth-go/auth"
	"github.com/gin-gonic/gin"
	"net/http"
)

func main() {
	// 初始化鉴权框架
	auth.Init(cache.AuthCacheAdapter{}, db.Apis)

	router := gin.Default()
	router.Use(middleware.Auth)
	router.Handle(http.MethodPost, "/user/login", Login)
	router.Handle(http.MethodPost, "/user/add", Add)
	router.Handle(http.MethodGet, "/user/query", Query)
	router.Handle(http.MethodGet, "/user/logout", Logout)

	router.Handle(http.MethodGet, "/timestamp", Timestamp)
}

func Login(c *gin.Context) {

}
func Add(c *gin.Context) {

}
func Query(c *gin.Context) {

}
func Logout(c *gin.Context) {

}
func Timestamp(c *gin.Context) {

}
